import java.util.ArrayList;


public class SystemInterface {
	
	Invoker invoker = new Invoker();
	
	public String getMenu()
	{	
		String strMenu= null;
		Menu menu = (Menu)invoker.getMenu();
		strMenu = traverseMenu(menu);
		return strMenu;
		
	}
	
	public String getPriceMenu(Double price)
	{				
		String strMenu= null;
		Menu menu = (Menu)invoker.getMenuByPrice(price);
		strMenu = traverseMenu(menu);
		
		return strMenu;
			
	}
	
	public String getIngredientMenu(String ingredient)
	{		
		String strMenu= null;
		Menu menu = (Menu)invoker.getMenuByIngredient(ingredient);
		strMenu = traverseMenu(menu);
		
		return strMenu;
	}
	
	public String getHearthHealthyMenu()
	{
		String strMenu= null;
		Menu menu = (Menu)invoker.getHeartHealthyMenu();
		strMenu = traverseMenu(menu);
		
		return strMenu;
	}	
	
	private String traverseMenu(Menu menu)
	{
		String strMenu ="";
		
		for(int i = 0; i < menu.getItems().size(); i++)
		{
			strMenu += menu.getItems().get(i).getName() + " " +
						menu.getItems().get(i).getPrice() + "\n";
			
		}
		
		return strMenu;
		
		
	}

}
